package com.xp.flower.qsd.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xp.flower.api.IBaseAreaService;
import com.xp.flower.common.ajax.AjaxResponse;
import com.xp.flower.common.dto.BaseAreaDTO;

@Controller
@RequestMapping("baseAreaController")
public class BaseAreaController {

    @Autowired
    private IBaseAreaService baseAreaServiceImpl;

    @RequestMapping("queryProvince")
    @ResponseBody
    public List<BaseAreaDTO> queryProvince() {
        return baseAreaServiceImpl.queryProvince();
    }

    @RequestMapping("queryAreaByParentId")
    @ResponseBody
    public List<BaseAreaDTO> queryAreaByParentId(@RequestParam(value = "parentId", required = true) Integer parentId) {
        return baseAreaServiceImpl.queryAreaByParentId(parentId);
    }
    
    public AjaxResponse<BaseAreaDTO> addBaseArea(BaseAreaDTO baseAreaDTO){
        Integer row = baseAreaServiceImpl.addBaseArea(baseAreaDTO);
        if(row > 0){
            
        }
        return null;
    }
    
    
}
